package engine.newUi
{
	import engine.control.loading.MultLoader;
	import engine.data.ResPath;
	import engine.flag.GameDefine;
	import engine.ui.MainUIManager;
	import engine.ui.lite.BaseUI;
	
	import flash.display.DisplayObjectContainer;
	import flash.display.MovieClip;
	import flash.display.Sprite;
	
	import newx.com.control.NxClip;
	import newx.com.control.button.NxButton;
	import newx.com.control.text.NxLabel;
	import newx.com.control.text.NxText;
	
	public class EscortSceneUI extends BaseUI
	{
		public var yunbiaoinfo:NxLabel;
		
		public var infoBack	:MovieClip
		public var logoPic		:MovieClip;
		public var moneyPic_1	:MovieClip;
		public var moneyPic_2	:MovieClip;
		public var pkinfoBack	:MovieClip;
		
		public var leftTimeLabel:NxLabel;
		
		public var info_1		:NxLabel;
		public var info_2		:NxLabel;
		public var info_3		:NxLabel;
		public var moneyText_1	:NxLabel;
		public var moneyText_2	:NxLabel;
		public var heroLabel	:NxLabel;
		public var overTime	:NxLabel;
		public var nextPkTime	:NxLabel;
		public var backMc		:NxClip;
		

//		public var hidePlay	:NxButton
		public var escortBtn	:NxButton;
		public var closeBtn	:NxButton;
		public var heroBtn		:NxButton;
		public var line		:MovieClip;
		public var OverBtn		:NxButton;
		public var addTime		:NxButton;
		public var palySpace	:Sprite;

		public var pkinfoTxt	:NxText;
		
		public var activePic	:MovieClip;
		public var activeLeftTime:NxLabel;
		
		public var springFestivalPic:MovieClip;
		public var springFestivalLab:NxLabel;

		private static var _self:EscortSceneUI;
		private var _myLogic:EscortSceneLogic;
		
		public function EscortSceneUI(popupUI:Boolean=true)
		{
			super(popupUI);
		}
		public static function getInstance():EscortSceneUI
		{
			if(_self == null)
			{
				_self	=	new EscortSceneUI();
			}
			return _self;
		}
		override public function Init():void
		{
//			hidePlay.visible	=	false;
//			backMc.source		=	ResPath.SWF + "escortScene.swf";
			_myLogic			=	EscortSceneLogic.getInstance();
		}
		override protected function AfterHide():void
		{
			this.created = false;
			_myLogic.removeListener();
			
			MainUIManager.getInstance().intoScene();
		}
		override protected function BeforeShow():void
		{
			this.created = true;
			_myLogic.addListener()
		}
		
//		override public function show(space:DisplayObjectContainer=null, onshow:Function=null, ...argc):void
//		{
//			if(!MultLoader.getInstance().load(ResPath.SWF + "escortScene.swf"))
//			{
//				MultLoader.getInstance().load([ResPath.SWF + "escortScene.swf"],true ,createImage);
//			}else
//			{
//				createImage();
//			}
//			
//		}
//		private function createImage():void
//		{
//			TourLogic.getInstance().BeforeShow();
//			MainUIManager.getInstance().intoScene(GameDefine.SceneType_EscortScene);
//		}
	}
}